<!DOCTYPE html>

<html>

<head>
    <title></title>
    <script src='../vue.js'></script>
</head>

<body>
    <div id="app-1">
        输入框插值
        <br/>
        <input v-model="message" placeholder="edit me">
        <p>Message is: {{ message }}</p>
        
        <hr/> 多行插值
        <br/>
        <span>Multiline message is:</span>
        <p style="white-space: pre-line">{{ areaMessage }}</p>
        <br/>
        <textarea v-model="areaMessage" placeholder="add multiple lines"></textarea>
        <hr/> checkbox
        <br/>
        <input type="checkbox" id="checkbox" v-model="checked">
        <label for="checkbox">{{ checked }}</label>
        
        <hr/> multiple checkbox
        <br/>
        <input type="checkbox" id="jack" value="Jack" v-model="checkedNames">
        <label for="jack">Jack</label>
        <input type="checkbox" id="john" value="John" v-model="checkedNames">
        <label for="john">John</label>
        <input type="checkbox" id="mike" value="Mike" v-model="checkedNames">
        <label for="mike">Mike</label>
        <br/>
        <span>Checked names: {{ checkedNames }}</span>
        
        <hr/> radio
        <br/>
        <input type="radio" id="one" value="One" v-model="picked">
        <label for="one">One</label>
        <br>
        <input type="radio" id="two" value="Two" v-model="picked">
        <label for="two">Two</label>
        <br>
        <span>Picked: {{ picked }}</span>
        
        <hr/> select
        <br/>
        <select v-model="selected">
            <option disabled value="">请选择</option>
            <option>A</option>
            <option>B</option>
            <option>C</option>
        </select>
        <span>Selected: {{ selected }}</span>
        
        <hr/> multiple select
        <br>
        <select v-model="multipleSelected" multiple style="width: 50px">
            <option>A</option>
            <option>B</option>
            <option>C</option>
        </select>
        <br>
        <span>Selected: {{ multipleSelected }}</span>
        
        <hr>dynamic select
        <br>
        <select v-model="dynamicSelected">
            <option v-for="option in options" v-bind:value="option.value">
                {{ option.text }}
            </option>
        </select>
        <span>Selected: {{ dynamicSelected }}</span>
    </div>
    <script>
        var app1 = new Vue({
            el: '#app-1',
            data: {
                message: 'Hello Vue!',
                areaMessage: 'Hello Vue!',
                checked: false,
                checkedNames: [],
                picked: '',
                selected: '',
                multipleSelected: '',
                options: [{
                        value: 'A',
                        text: 'one'
                    },
                    {
                        value: 'B',
                        text: 'two'
                    },
                    {
                        value: 'C',
                        text: 'three'
                    }
                ],
                dynamicSelected: ''
            }
        });
    </script>
</body>

</html>